<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>渐变</title>
    <style>
        .box {
            width: 300px;
            height: 400px;
            border: 1px solid black;
            margin-left: 60px;
            float: left;
        }

        .box1 {
            background-image: linear-gradient(red, yellow, green);

        }

        .box2 {
            background-image: linear-gradient(to right top, red, yellow, green);
        }

        .box3 {
            background-image: linear-gradient(30deg, red, yellow, green);
        }

        .box4 {
            background-image: linear-gradient(red 50px, yellow 100px, green 150px, blue 300px);
        }

        .box5 {
            background-image: repeating-linear-gradient(red 50px, yellow 100px, green 150px, blue 300px);
        }

        .box6 {
            background-image: linear-gradient(30deg, red 50px, yellow 200px, green 350px);
            font-size: 100px;
            text-align: center;
            line-height: 400px;
            font-weight: bold;
            color: transparent;
            -webkit-background-clip: text;
        }
    </style>
</head>

<body>
    <div class="box box1">1</div>
    <div class="box box2">2</div>
    <div class="box box3">3</div>
    <div class="box box4">4</div>
    <div class="box box5">5</div>
    <div class="box box6">Hello</div>
</body>

</html>